package org.darkforest.enums;

/**
 * Created by pc on 2016/1/27.
 */
public enum RefundStateEnum {
    PROCESSED(1,"处理中")
    ,PASS(2,"待管理员处理")
    ,DONE(3,"已完成")
    ;

    private String text;
    private Integer value;
    public String getText() {
        return text;
    }
    public void setText(String text) {
        this.text = text;
    }
    public Integer getValue() {
        return value;
    }
    public void setValue(Integer value) {
        this.value = value;
    }
    private RefundStateEnum(Integer value, String text) {
        this.text = text;
        this.value = value;
    }

    public static RefundStateEnum getByValue(String value){
        try {
            getByValue(Integer.parseInt(value));
        } catch (Exception e) {

        }
        return null;
    }
    public static RefundStateEnum getByValue(Integer value){
        for(RefundStateEnum e : RefundStateEnum.values()){
            if(e.value == value){
                return e;
            }
        }
        return null;
    }
}
